package com.ruoyi.fts.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fts.mapper.FtsBookCatalogueMapper;
import com.ruoyi.fts.domain.FtsBookCatalogue;
import com.ruoyi.fts.service.IFtsBookCatalogueService;

/**
 * 书籍目录Service业务层处理
 *
 * @author lumberer
 * @date 2024-11-20
 */
@Service
public class FtsBookCatalogueServiceImpl extends ServiceImpl<FtsBookCatalogueMapper, FtsBookCatalogue> implements IFtsBookCatalogueService {
    @Autowired
    private FtsBookCatalogueMapper ftsBookCatalogueMapper;

    /**
     * 查询书籍目录
     *
     * @param id 书籍目录主键
     * @return 书籍目录
     */
    @Override
    public FtsBookCatalogue selectFtsBookCatalogueById(Long id) {
        return ftsBookCatalogueMapper.selectFtsBookCatalogueById(id);
    }

    /**
     * 查询书籍目录列表
     *
     * @param ftsBookCatalogue 书籍目录
     * @return 书籍目录
     */
    @Override
    public List<FtsBookCatalogue> selectFtsBookCatalogueList(FtsBookCatalogue ftsBookCatalogue) {
        return ftsBookCatalogueMapper.selectFtsBookCatalogueList(ftsBookCatalogue);
    }

    /**
     * 新增书籍目录
     *
     * @param ftsBookCatalogue 书籍目录
     * @return 结果
     */
    @Override
    public int insertFtsBookCatalogue(FtsBookCatalogue ftsBookCatalogue) {
                ftsBookCatalogue.setCreateTime(DateUtils.getNowDate());
            return ftsBookCatalogueMapper.insert(ftsBookCatalogue);
    }

    /**
     * 修改书籍目录
     *
     * @param ftsBookCatalogue 书籍目录
     * @return 结果
     */
    @Override
    public int updateFtsBookCatalogue(FtsBookCatalogue ftsBookCatalogue) {
        return ftsBookCatalogueMapper.updateById(ftsBookCatalogue);
    }

    /**
     * 批量删除书籍目录
     *
     * @param ids 需要删除的书籍目录主键
     * @return 结果
     */
    @Override
    public int deleteFtsBookCatalogueByIds(Long[] ids) {
        return ftsBookCatalogueMapper.deleteFtsBookCatalogueByIds(ids);
    }

    /**
     * 删除书籍目录信息
     *
     * @param id 书籍目录主键
     * @return 结果
     */
    @Override
    public int deleteFtsBookCatalogueById(Long id) {
        return ftsBookCatalogueMapper.deleteFtsBookCatalogueById(id);
    }
}